package com.yifi.system.service;

import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;
import com.yifi.common.utils.DateUtils;

/** 
* @ClassName: MisAttachService 
* @Description: TODO
* @author 姚善利
* @date 2021-8-5 16:58:43 
*  
*/
public class MisAttachService {

	public boolean add(String id,String fname,String cpath,String cext,String m_id,String user,String org
			,String ckey_word,String cclassification,String cdoc_status,String cfile_size,String cdoc_type
			,String desc,String cfull_url,String source)
	{

		Record rec=new Record();
		rec.set("id", id);
		rec.set("cdesc", desc);
		rec.set("cpath", cpath);
		rec.set("cext", cext);
		rec.set("m_id", m_id);
		rec.set("cupload_user", user);
		rec.set("cupload_org", org);
		rec.set("cupload_dept", org);
		rec.set("ckey_word", ckey_word);
		rec.set("cclassification", cclassification);
		rec.set("dupload_date", DateUtils.getNowDate());
		rec.set("cdoc_status", cdoc_status);
		rec.set("cfile_size", cfile_size);
		rec.set("cfiletitle", fname);
		rec.set("cfull_url", cfull_url);
		rec.set("isort", "1");
		rec.set("cdoc_type", cdoc_type);
		rec.set("source", source);
		rec.set("cversion", 1);
		
		return Db.save("mis_attach","id", rec);

	}
	
	public boolean delete(String id)
	{
		String sql="delete from mis_attach where id=?";
		
		return (Db.update(sql)>0);
	}
}
